import fetch from '../utils/fetch'
import config from '../utils/config'
import { querystring } from 'vux'

// 我的合同接口
var MyContractService = {
  GetMyContract (providerGUID) {
    var data = {
      action: 'GetMyContract',
      ProviderGUID: providerGUID
    }
    var url = config.API_SERVER + '/WXApi.ajax?' + querystring.stringify(data)
    return fetch({
      url: url,
      method: 'GET'
    })
  },
  GetMyContractDetail (providerGUID, contractGUID) {
    var data = {
      action: 'GetMyContractDetail',
      ProviderGUID: providerGUID,
      ContractGUID: contractGUID
    }
    var url = config.API_SERVER + '/WXApi.ajax?' + querystring.stringify(data)
    return fetch({
      url: url,
      method: 'GET'
    })
  },
  GetHTBalanceApply (providerGUID, contractGUID) {
    var data = {
      action: 'GetHTBalanceApply',
      ProviderGUID: providerGUID,
      ContractGUID: contractGUID
    }
    var url = config.API_SERVER + '/WXApi.ajax?' + querystring.stringify(data)
    return fetch({
      url: url,
      method: 'GET'
    })
  },
  GetPGSubject (providerGUID, contractGUID) {
    var data = {
      action: 'GetPGSubject',
      ProviderGUID: providerGUID,
      ContractGUID: contractGUID
    }
    var url = config.API_SERVER + '/WXApi.ajax?' + querystring.stringify(data)
    return fetch({
      url: url,
      method: 'GET'
    })
  },
  GetFkjhApply (providerGUID, contractGUID) {
    var data = {
      action: 'GetFkjhApply',
      ProviderGUID: providerGUID,
      ContractGUID: contractGUID
    }
    var url = config.API_SERVER + '/WXApi.ajax?' + querystring.stringify(data)
    return fetch({
      url: url,
      method: 'GET'
    })
  }
}

export default MyContractService
